package net.ufrog.common.weixin.pojos;

import java.util.ArrayList;
import java.util.List;

import net.ufrog.common.dict.Element;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * 用户基本信息
 * 
 * @author ultrafrog
 * @version 1.0, 2014年12月30日
 * @since 1.0
 */
public class UserInfo extends Err {

	private static final long serialVersionUID = -6017939758072710498L;

	/** 关注标识 */
	private Integer subscribe;
	
	/** 用户编号 */
	private String openid;
	
	/** 昵称 */
	private String nickname;
	
	/** 性别 */
	private Integer sex;
	
	/** 语言 */
	private String language;
	
	/** 城市 */
	private String city;
	
	/** 省份 */
	private String province;
	
	/** 国家 */
	private String country;
	
	/** 头像 */
	private String headimgurl;
	
	/** 关注时间 */
	@JSONField(name = "subscribe_time")
	private Long subscribeTime;
	
	/** 唯一编号<br>多应用时同一平台号唯一 */
	private String unionid;
	
	/** 备注 */
	private String remark;
	
	/** 分组编号 */
	private String groupid;
	
	/** 特权信息 */
	private List<String> privilege;

	/** 构造函数 */
	public UserInfo() {
		privilege = new ArrayList<String>();
	}
	
	/**
	 * 读取关注标识
	 * 
	 * @return
	 * @see #subscribe
	 */
	public Integer getSubscribe() {
		return subscribe;
	}

	/**
	 * 设置关注标识
	 * 
	 * @param subscribe
	 * @see #subscribe
	 */
	public void setSubscribe(Integer subscribe) {
		this.subscribe = subscribe;
	}

	/**
	 * 读取用户编号
	 * 
	 * @return
	 * @see #openid
	 */
	public String getOpenid() {
		return openid;
	}

	/**
	 * 设置用户编号
	 * 
	 * @param openid
	 * @see #openid
	 */
	public void setOpenid(String openid) {
		this.openid = openid;
	}

	/**
	 * 读取昵称
	 * 
	 * @return
	 * @see #nickname
	 */
	public String getNickname() {
		return nickname;
	}

	/**
	 * 设置昵称
	 * 
	 * @param nickname
	 * @see #nickname
	 */
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	/**
	 * 读取性别
	 * 
	 * @return
	 * @see #sex
	 */
	public Integer getSex() {
		return sex;
	}

	/**
	 * 设置性别
	 * 
	 * @param sex
	 * @see #sex
	 */
	public void setSex(Integer sex) {
		this.sex = sex;
	}

	/**
	 * 读取语言
	 * 
	 * @return
	 * @see #language
	 */
	public String getLanguage() {
		return language;
	}

	/**
	 * 设置语言
	 * 
	 * @param language
	 * @see #language
	 */
	public void setLanguage(String language) {
		this.language = language;
	}

	/**
	 * 读取城市
	 * 
	 * @return
	 * @see #city
	 */
	public String getCity() {
		return city;
	}

	/**
	 * 设置城市
	 * 
	 * @param city
	 * @see #city
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * 读取省份
	 * 
	 * @return
	 * @see #province
	 */
	public String getProvince() {
		return province;
	}

	/**
	 * 设置省份
	 * 
	 * @param province
	 * @see #province
	 */
	public void setProvince(String province) {
		this.province = province;
	}

	/**
	 * 读取国家
	 * 
	 * @return
	 * @see #country
	 */
	public String getCountry() {
		return country;
	}

	/**
	 * 设置国家
	 * 
	 * @param country
	 * @see #country
	 */
	public void setCountry(String country) {
		this.country = country;
	}

	/**
	 * 读取头像
	 * 
	 * @return
	 * @see #headimgurl
	 */
	public String getHeadimgurl() {
		return headimgurl;
	}

	/**
	 * 设置头像
	 * 
	 * @param headimgurl
	 * @see #headimgurl
	 */
	public void setHeadimgurl(String headimgurl) {
		this.headimgurl = headimgurl;
	}

	/**
	 * 读取关注时间
	 * 
	 * @return
	 * @see #subscribeTime
	 */
	public Long getSubscribeTime() {
		return subscribeTime;
	}

	/**
	 * 设置关注时间
	 * 
	 * @param subscribeTime
	 * @see #subscribeTime
	 */
	public void setSubscribeTime(Long subscribeTime) {
		this.subscribeTime = subscribeTime;
	}

	/**
	 * 读取唯一编号
	 * 
	 * @return
	 * @see #unionid
	 */
	public String getUnionid() {
		return unionid;
	}

	/**
	 * 设置唯一编号
	 * 
	 * @param unionid
	 * @see #unionid
	 */
	public void setUnionid(String unionid) {
		this.unionid = unionid;
	}

	/**
	 * 读取备注
	 * 
	 * @return
	 * @see #remark
	 */
	public String getRemark() {
		return remark;
	}

	/**
	 * 设置备注
	 * 
	 * @param remark
	 * @see #remark
	 */
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * 读取分组编号
	 * 
	 * @return
	 * @see #groupid
	 */
	public String getGroupid() {
		return groupid;
	}

	/**
	 * 设置分组编号
	 * 
	 * @param groupid
	 * @see #groupid
	 */
	public void setGroupid(String groupid) {
		this.groupid = groupid;
	}
	
	/**
	 * 读取特权信息
	 * 
	 * @return
	 * @see #privilege
	 */
	public List<String> getPrivilege() {
		return privilege;
	}
	
	/**
	 * 关注
	 * 
	 * @author ultrafrog
	 * @version 1.0, 2015-12-01
	 * @since 1.0
	 */
	public static final class Subscribe {
		
		@Element("未关注")
		public static final Integer UNSUBSCRIBE	= 0;
		
		@Element("已关注")
		public static final Integer SUBSCRIBED	= 1;
	}
	
	/**
	 * 性别
	 * 
	 * @author ultrafrog
	 * @version 1.0, 2015-12-01
	 * @since 1.0
	 */
	public static final class Sex {
		
		@Element("未知")
		public static final Integer UNKNOW	= 0;
		
		@Element("男")
		public static final Integer MALE	= 1;
		
		@Element("女")
		public static final Integer FEMALE	= 2;
	}
}
